# -*- coding: utf-8 -*-
"""
Module Description: 保存peewee源(mysql)的model
Date: 2016/11/8
Author:Bai Jin Ping
"""
import peewee

from framework.dal.models import BaseCharacterModel
from character import *
from framework.dal.profile_model import *

# 所有的数据库模型
all_db_models = []


def register_all_models():
    """将所有dbmodel注册到all_db_models"""
    for k, v in globals().iteritems():
        if type(v) == peewee.BaseModel \
                and v is not BaseCharacterModel \
                and issubclass(v, BaseCharacterModel):
            all_db_models.append(v)


register_all_models()
